Lab9 methods
In [1]:
Copied!
from GeoBay.GeoBay import CustomIpyleafletMap as ipyleaflet_Map
# Example 1: Basic map with Search Control
m = ipyleaflet_Map(center=[37.7749, -122.4194], zoom=4)
m.add_search_control()
m.show_map()
from GeoBay.GeoBay import CustomIpyleafletMap as ipyleaflet_Map
# Example 1: Basic map with Search Control
m = ipyleaflet_Map(center=[37.7749, -122.4194], zoom=4)
m.add_search_control()
m.show_map()
Out[1]:
In [2]:
Copied!
# Example 2: Adding a custom WMS layer to the map
m = ipyleaflet_Map(center=[0, 0], zoom=2)
m.add_esa_worldcover()
m.show_map()
# Example 2: Adding a custom WMS layer to the map
m = ipyleaflet_Map(center=[0, 0], zoom=2)
m.add_esa_worldcover()
m.show_map()
Out[2]:
In [3]:
Copied!
#Example 3: Marker Clusters
import geopandas as gpd
# Load building centroids GeoJSON
url = "https://github.com/opengeos/datasets/releases/download/places/wa_building_centroids.geojson"
gdf = gpd.read_file(url)
# Add lat/lon columns from geometry
gdf["longitude"] = gdf.geometry.x
gdf["latitude"] = gdf.geometry.y
# Create map and add circle markers
m = ipyleaflet_Map(center=[gdf.latitude.mean(), gdf.longitude.mean()], zoom=14)
m.add_circle_markers_from_xy(gdf)
m.show_map()
#Example 3: Marker Clusters
import geopandas as gpd
# Load building centroids GeoJSON
url = "https://github.com/opengeos/datasets/releases/download/places/wa_building_centroids.geojson"
gdf = gpd.read_file(url)
# Add lat/lon columns from geometry
gdf["longitude"] = gdf.geometry.x
gdf["latitude"] = gdf.geometry.y
# Create map and add circle markers
m = ipyleaflet_Map(center=[gdf.latitude.mean(), gdf.longitude.mean()], zoom=14)
m.add_circle_markers_from_xy(gdf)
m.show_map()
Out[3]:
In [4]:
Copied!
#Example 4 : Add polygons, road lines, and choropleth
from GeoBay.GeoBay import CustomIpyleafletMap as ipyleaflet_Map
m = ipyleaflet_Map(center=[47.6588, -117.4260], zoom=12)
# Add building polygons
m.add_building_polygons("https://github.com/opengeos/datasets/releases/download/places/wa_overture_buildings.geojson")
m.add_layer_control()
m.show_map()
#Example 4 : Add polygons, road lines, and choropleth
from GeoBay.GeoBay import CustomIpyleafletMap as ipyleaflet_Map
m = ipyleaflet_Map(center=[47.6588, -117.4260], zoom=12)
# Add building polygons
m.add_building_polygons("https://github.com/opengeos/datasets/releases/download/places/wa_overture_buildings.geojson")
m.add_layer_control()
m.show_map()
Out[4]:
In [5]:
Copied!
# Add road lines
m = ipyleaflet_Map(center=[36.1699, -115.1398], zoom=12)
m.add_roads("https://github.com/opengeos/datasets/releases/download/places/las_vegas_roads.geojson")
m.add_layer_control()
m.show_map()
# Add road lines
m = ipyleaflet_Map(center=[36.1699, -115.1398], zoom=12)
m.add_roads("https://github.com/opengeos/datasets/releases/download/places/las_vegas_roads.geojson")
m.add_layer_control()
m.show_map()
Out[5]:
In [6]:
Copied!
# Add choropleth
m.add_choropleth("https://github.com/opengeos/datasets/releases/download/us/us_counties.geojson", "CENSUSAREA", colormap="YlOrRd_09")
m.add_layer_control()
m.show_map()
# Add choropleth
m.add_choropleth("https://github.com/opengeos/datasets/releases/download/us/us_counties.geojson", "CENSUSAREA", colormap="YlOrRd_09")
m.add_layer_control()
m.show_map()
Out[6]:
In [7]:
Copied!
# Example 5: Splitmap
from GeoBay.GeoBay import CustomIpyleafletMap as ipyleaflet_Map
pre_url = "https://github.com/opengeos/datasets/releases/download/raster/Libya-2023-07-01.tif"
post_url = "https://github.com/opengeos/datasets/releases/download/raster/Libya-2023-09-13.tif"
m = ipyleaflet_Map(center=[26.33, 17.23], zoom=12)
leafmap_split = m.add_split_rasters_leafmap(pre_url, post_url, overwrite=True)
leafmap_split
# Example 5: Splitmap
from GeoBay.GeoBay import CustomIpyleafletMap as ipyleaflet_Map
pre_url = "https://github.com/opengeos/datasets/releases/download/raster/Libya-2023-07-01.tif"
post_url = "https://github.com/opengeos/datasets/releases/download/raster/Libya-2023-09-13.tif"
m = ipyleaflet_Map(center=[26.33, 17.23], zoom=12)
leafmap_split = m.add_split_rasters_leafmap(pre_url, post_url, overwrite=True)
leafmap_split
Downloading... From: https://github.com/opengeos/datasets/releases/download/raster/Libya-2023-07-01.tif To: C:\Users\shea9\Documents\Github\GeoBay\docs\examples\pre_event.tif
0%| | 0.00/72.1M [00:00<?, ?B/s]
1%|█▏ | 524k/72.1M [00:00<00:13, 5.19MB/s]
2%|███▋ | 1.57M/72.1M [00:00<00:10, 6.99MB/s]
4%|███████▎ | 3.15M/72.1M [00:00<00:07, 8.83MB/s]
7%|██████████▉ | 4.72M/72.1M [00:00<00:06, 9.69MB/s]
8%|█████████████▍ | 5.77M/72.1M [00:00<00:06, 9.60MB/s]
10%|█████████████████ | 7.34M/72.1M [00:00<00:06, 10.0MB/s]
12%|███████████████████▌ | 8.39M/72.1M [00:00<00:06, 9.94MB/s]
13%|█████████████████████▉ | 9.44M/72.1M [00:00<00:06, 9.99MB/s]
15%|████████████████████████▍ | 10.5M/72.1M [00:01<00:07, 7.98MB/s]
18%|██████████████████████████████▌ | 13.1M/72.1M [00:01<00:04, 12.0MB/s]
20%|██████████████████████████████████▏ | 14.7M/72.1M [00:01<00:04, 12.0MB/s]
23%|█████████████████████████████████████▊ | 16.3M/72.1M [00:01<00:04, 12.1MB/s]
25%|█████████████████████████████████████████▌ | 17.8M/72.1M [00:01<00:04, 11.9MB/s]
27%|█████████████████████████████████████████████▏ | 19.4M/72.1M [00:01<00:04, 11.9MB/s]
29%|████████████████████████████████████████████████▊ | 21.0M/72.1M [00:01<00:04, 11.8MB/s]
31%|████████████████████████████████████████████████████▌ | 22.5M/72.1M [00:02<00:04, 11.8MB/s]
33%|████████████████████████████████████████████████████████▏ | 24.1M/72.1M [00:02<00:04, 11.9MB/s]
36%|███████████████████████████████████████████████████████████▊ | 25.7M/72.1M [00:02<00:03, 11.9MB/s]
38%|███████████████████████████████████████████████████████████████▌ | 27.3M/72.1M [00:02<00:03, 11.7MB/s]
40%|███████████████████████████████████████████████████████████████████▏ | 28.8M/72.1M [00:02<00:03, 11.2MB/s]
42%|██████████████████████████████████████████████████████████████████████▊ | 30.4M/72.1M [00:02<00:03, 10.9MB/s]
45%|███████████████████████████████████████████████████████████████████████████▋ | 32.5M/72.1M [00:02<00:03, 12.0MB/s]
47%|███████████████████████████████████████████████████████████████████████████████▍ | 34.1M/72.1M [00:03<00:03, 11.9MB/s]
49%|███████████████████████████████████████████████████████████████████████████████████ | 35.7M/72.1M [00:03<00:03, 12.0MB/s]
52%|██████████████████████████████████████████████████████████████████████████████████████▋ | 37.2M/72.1M [00:03<00:02, 11.7MB/s]
54%|██████████████████████████████████████████████████████████████████████████████████████████▍ | 38.8M/72.1M [00:03<00:02, 11.7MB/s]
56%|██████████████████████████████████████████████████████████████████████████████████████████████ | 40.4M/72.1M [00:03<00:02, 11.4MB/s]
58%|█████████████████████████████████████████████████████████████████████████████████████████████████▋ | 41.9M/72.1M [00:03<00:02, 10.9MB/s]
60%|█████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 43.5M/72.1M [00:03<00:02, 10.1MB/s]
62%|███████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 44.6M/72.1M [00:04<00:02, 9.27MB/s]
63%|██████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 45.6M/72.1M [00:04<00:03, 8.53MB/s]
65%|████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 46.7M/72.1M [00:04<00:03, 8.19MB/s]
66%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 47.7M/72.1M [00:04<00:03, 7.48MB/s]
68%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 48.8M/72.1M [00:04<00:03, 6.88MB/s]
69%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 49.8M/72.1M [00:04<00:03, 6.42MB/s]
71%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 50.9M/72.1M [00:05<00:03, 5.61MB/s]
72%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 51.9M/72.1M [00:05<00:04, 4.95MB/s]
73%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 53.0M/72.1M [00:05<00:04, 4.40MB/s]
74%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 53.5M/72.1M [00:05<00:04, 4.14MB/s]
75%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 54.0M/72.1M [00:06<00:04, 3.87MB/s]
76%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 54.5M/72.1M [00:06<00:04, 3.63MB/s]
76%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 55.1M/72.1M [00:06<00:04, 3.52MB/s]
77%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 55.6M/72.1M [00:06<00:04, 3.36MB/s]
78%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 56.1M/72.1M [00:06<00:04, 3.66MB/s]
79%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 57.1M/72.1M [00:06<00:03, 4.24MB/s]
81%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 58.2M/72.1M [00:07<00:02, 4.98MB/s]
82%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 59.2M/72.1M [00:07<00:02, 5.53MB/s]
84%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 60.3M/72.1M [00:07<00:01, 5.94MB/s]
85%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 61.3M/72.1M [00:07<00:01, 6.13MB/s]
87%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 62.4M/72.1M [00:07<00:01, 6.17MB/s]
88%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 63.4M/72.1M [00:07<00:01, 6.20MB/s]
89%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 64.5M/72.1M [00:08<00:01, 6.47MB/s]
91%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 65.5M/72.1M [00:08<00:00, 6.62MB/s]
92%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 66.6M/72.1M [00:08<00:00, 6.51MB/s]
94%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 67.6M/72.1M [00:08<00:00, 5.62MB/s]
95%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 68.7M/72.1M [00:08<00:00, 5.10MB/s]
97%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 69.7M/72.1M [00:09<00:00, 4.70MB/s]
97%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 70.3M/72.1M [00:09<00:00, 4.64MB/s]
98%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 70.8M/72.1M [00:09<00:00, 4.56MB/s]
99%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 71.3M/72.1M [00:09<00:00, 4.63MB/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎| 71.8M/72.1M [00:09<00:00, 4.71MB/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 72.1M/72.1M [00:09<00:00, 7.49MB/s]
Downloading... From: https://github.com/opengeos/datasets/releases/download/raster/Libya-2023-09-13.tif To: C:\Users\shea9\Documents\Github\GeoBay\docs\examples\post_event.tif
0%| | 0.00/104M [00:00<?, ?B/s]
1%|▊ | 524k/104M [00:00<00:20, 5.17MB/s]
2%|██▌ | 1.57M/104M [00:00<00:13, 7.47MB/s]
3%|█████ | 3.15M/104M [00:00<00:10, 9.63MB/s]
5%|███████▋ | 4.72M/104M [00:00<00:09, 10.6MB/s]
6%|██████████▏ | 6.29M/104M [00:00<00:08, 11.1MB/s]
8%|████████████▊ | 7.86M/104M [00:00<00:08, 11.5MB/s]
9%|███████████████▎ | 9.44M/104M [00:00<00:07, 11.8MB/s]
11%|█████████████████▉ | 11.0M/104M [00:01<00:07, 11.8MB/s]
12%|████████████████████▍ | 12.6M/104M [00:01<00:07, 11.9MB/s]
14%|███████████████████████ | 14.2M/104M [00:01<00:07, 11.9MB/s]
15%|█████████████████████████▌ | 15.7M/104M [00:01<00:07, 12.1MB/s]
17%|████████████████████████████▏ | 17.3M/104M [00:01<00:07, 12.0MB/s]
18%|██████████████████████████████▋ | 18.9M/104M [00:01<00:07, 12.1MB/s]
20%|█████████████████████████████████▎ | 20.4M/104M [00:01<00:06, 12.1MB/s]
21%|███████████████████████████████████▊ | 22.0M/104M [00:01<00:06, 12.2MB/s]
23%|██████████████████████████████████████▍ | 23.6M/104M [00:02<00:06, 12.2MB/s]
24%|████████████████████████████████████████▉ | 25.2M/104M [00:02<00:06, 12.1MB/s]
26%|███████████████████████████████████████████▍ | 26.7M/104M [00:02<00:06, 12.3MB/s]
27%|██████████████████████████████████████████████ | 28.3M/104M [00:02<00:06, 12.0MB/s]
29%|████████████████████████████████████████████████▌ | 29.9M/104M [00:02<00:06, 12.0MB/s]
30%|███████████████████████████████████████████████████▏ | 31.5M/104M [00:02<00:05, 12.2MB/s]
32%|█████████████████████████████████████████████████████▋ | 33.0M/104M [00:02<00:05, 12.2MB/s]
33%|████████████████████████████████████████████████████████▎ | 34.6M/104M [00:02<00:05, 12.3MB/s]
35%|██████████████████████████████████████████████████████████▊ | 36.2M/104M [00:03<00:05, 12.3MB/s]
36%|█████████████████████████████████████████████████████████████▍ | 37.7M/104M [00:03<00:05, 12.1MB/s]
38%|███████████████████████████████████████████████████████████████▉ | 39.3M/104M [00:03<00:07, 8.36MB/s]
41%|█████████████████████████████████████████████████████████████████████▉ | 43.0M/104M [00:03<00:04, 13.0MB/s]
43%|█████████████████████████████████████████████████████████████████████████▎ | 45.1M/104M [00:03<00:04, 12.7MB/s]
45%|███████████████████████████████████████████████████████████████████████████▉ | 46.7M/104M [00:03<00:04, 12.4MB/s]
46%|██████████████████████████████████████████████████████████████████████████████▍ | 48.2M/104M [00:04<00:04, 12.5MB/s]
48%|█████████████████████████████████████████████████████████████████████████████████ | 49.8M/104M [00:04<00:04, 12.4MB/s]
49%|███████████████████████████████████████████████████████████████████████████████████▌ | 51.4M/104M [00:04<00:04, 12.2MB/s]
51%|██████████████████████████████████████████████████████████████████████████████████████▏ | 53.0M/104M [00:04<00:04, 12.1MB/s]
52%|████████████████████████████████████████████████████████████████████████████████████████▋ | 54.5M/104M [00:04<00:04, 12.0MB/s]
54%|███████████████████████████████████████████████████████████████████████████████████████████▎ | 56.1M/104M [00:04<00:03, 12.2MB/s]
56%|█████████████████████████████████████████████████████████████████████████████████████████████▊ | 57.7M/104M [00:05<00:05, 9.00MB/s]
59%|██████████████████████████████████████████████████████████████████████████████████████████████████▉ | 60.8M/104M [00:05<00:03, 13.1MB/s]
60%|█████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 62.4M/104M [00:05<00:03, 11.8MB/s]
62%|████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 64.5M/104M [00:05<00:03, 12.6MB/s]
64%|███████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 66.1M/104M [00:05<00:02, 12.6MB/s]
65%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 67.6M/104M [00:05<00:02, 12.4MB/s]
67%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 69.2M/104M [00:05<00:02, 12.5MB/s]
68%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 70.8M/104M [00:05<00:02, 12.2MB/s]
70%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 72.4M/104M [00:06<00:02, 12.1MB/s]
71%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 73.9M/104M [00:06<00:02, 12.3MB/s]
73%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 75.5M/104M [00:06<00:02, 12.1MB/s]
74%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 77.1M/104M [00:06<00:02, 12.0MB/s]
76%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 78.6M/104M [00:06<00:02, 12.0MB/s]
77%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 80.2M/104M [00:06<00:01, 11.8MB/s]
79%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 81.8M/104M [00:06<00:01, 12.1MB/s]
80%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 83.4M/104M [00:07<00:01, 12.1MB/s]
82%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 84.9M/104M [00:07<00:01, 11.9MB/s]
83%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 86.5M/104M [00:07<00:01, 11.7MB/s]
85%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 88.1M/104M [00:07<00:01, 11.7MB/s]
86%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 89.7M/104M [00:07<00:01, 11.9MB/s]
88%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 91.2M/104M [00:07<00:01, 11.7MB/s]
89%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 92.8M/104M [00:07<00:00, 11.7MB/s]
91%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 94.4M/104M [00:07<00:00, 11.9MB/s]
92%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 95.9M/104M [00:08<00:00, 11.8MB/s]
94%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 97.5M/104M [00:08<00:00, 11.7MB/s]
95%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 99.1M/104M [00:08<00:00, 11.7MB/s]
97%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 101M/104M [00:08<00:00, 11.6MB/s]
98%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 102M/104M [00:08<00:00, 11.6MB/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊| 104M/104M [00:08<00:00, 11.7MB/s]
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 104M/104M [00:08<00:00, 11.8MB/s]
Out[7]:
In [ ]:
Copied!